<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="../css/public.css" media="all">
</head>


<body class="layui-layout-body layuimini-all">
    <div class="layuimini-container">

        <div id="one" style="width: 600px;height:600px; margin-left: 300px;margin-top: 20px;">

        </div>
        <div style="width: 600px;height:200px; margin-left: 300px;">

        </div>
    </div>
    <!-- <div id="main" style="width: 600px;height:400px;">
    </div> -->
    <script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="../js/echarts.js" ,type="text/javascript"></script>
    <script>
        layui.use(['form', 'jquery', 'table'], function () {
            var $ = layui.jquery,
                form = layui.form,
                layer = layui.layer,
                table = layui.table;
            // var aname = localStorage.getItem('aname');
            $(function () {
                $.get('/showExpert', {
                    status: 3,
                }, function (re) {
                    if (re == '0') {
                        layer.msg("暂无专家！");
                    } else {
                        console.log(re);
                        var obj = re.data;
                        var len = re.count;
                    }
                    if (obj[0].type == 2) {
                        html = '';
                        for (var i = 0; i < len; i++) {
                            var myChart = echarts.init(document.getElementById('one'));
                            var option;
                            //var name = obj[i].p_expert_name;
                            var name = obj[i].p_expert_name;
                            option = {
                                color: ['#6e42e6'],
                                title: {
                                    text: name + '学术水平雷达图',
                                    left: 'center'
                                },
                                // legend: {
                                //     data: ['学术水平']
                                // },
                                radar: {
                                    // shape: 'circle',
                                    indicator: [{
                                            name: '工作单位',
                                            max: 100
                                        },
                                        {
                                            name: '从业时长',
                                            max: 100
                                        },
                                        {
                                            name: '学历',
                                            max: 100
                                        },
                                        {
                                            name: '专业领域',
                                            max: 100
                                        },
                                        {
                                            name: '年龄',
                                            max: 100
                                        },
                                        {
                                            name: '职称',
                                            max: 100
                                        }
                                    ],
                                    axisName: {
                                        color: '#fff',
                                        backgroundColor: '#666',
                                        borderRadius: 3,
                                        padding: [4, 5]
                                    }
                                },
                                series: [{
                                    name: 'Budget vs spending',
                                    type: 'radar',
                                    data: [{
                                        value: [
                                            ((obj[i].w_place *
                                                    100) /
                                                0.2).toFixed(
                                                2),
                                            ((obj[i].w_time *
                                                    100) /
                                                0.1).toFixed(
                                                2),
                                            ((obj[i].edu *
                                                100) / 0.1)
                                            .toFixed(
                                                2),
                                            ((obj[i].field *
                                                100) / 0.3)
                                            .toFixed(
                                                2),
                                            ((obj[i].age *
                                                100) / 0.1)
                                            .toFixed(
                                                2),
                                            ((obj[i].p_title *
                                                    100) /
                                                0.2).toFixed(2)
                                        ],
                                        name: '学术水平',
                                        symbol: 'circle',
                                        symbolSize: 9,
                                        lineStyle: {
                                            color: 'rgba(170, 145, 200, 0.9)',
                                            type: 'dashed'
                                        },

                                        areaStyle: {
                                            color: new echarts
                                                .graphic
                                                .RadialGradient(0.1,
                                                    0.6, 1,
                                                    [{
                                                            color: 'rgba(190, 145, 200, 0.1)',
                                                            offset: 0
                                                        },
                                                        {
                                                            color: 'rgba(190, 145, 200, 0.9)',
                                                            offset: 1
                                                        }
                                                    ])
                                        },
                                        label: {
                                            show: true,
                                            fontSize: 15,
                                            color: '#6e42e6',
                                            formatter: function (
                                                params) {
                                                return params
                                                    .value;
                                            }
                                        }
                                    }]
                                }]
                            };
                            option && myChart.setOption(option);
                        }
                        // a = a + 0.01;
                    } else if (obj[0].type == 1) {
                        for (var i = 0; i < len; i++) {
                            var myChart = echarts.init(document
                                .getElementById('one'));
                            var option;
                            //var name = obj[i].p_expert_name;
                            var name = obj[i].s_expert_name;
                            var option;
                            option = {
                                color: ['#6e42e6'],
                                title: {
                                    text: name + '学术水平雷达图',
                                    left: 'center'
                                },
                                // legend: {
                                //     data: ['学术水平']
                                // },
                                radar: {
                                    // shape: 'circle',
                                    indicator: [{
                                            name: '校内职务',
                                            max: 100
                                        },
                                        {
                                            name: '防疫志愿者时长',
                                            max: 100
                                        },
                                        {
                                            name: '上网课时长',
                                            max: 100
                                        }
                                    ],
                                    axisName: {
                                        color: '#fff',
                                        backgroundColor: '#666',
                                        borderRadius: 3,
                                        padding: [4, 5]
                                    }
                                },
                                series: [{
                                    name: 'Budget vs spending',
                                    type: 'radar',
                                    data: [{
                                        value: [
                                            ((obj[i].s_title *
                                                    100
                                                ) /
                                                0.4
                                            )
                                            .toFixed(
                                                2
                                            ),
                                            ((obj[i].v_time *
                                                    100
                                                ) /
                                                0.5
                                            )
                                            .toFixed(
                                                2
                                            ),
                                            ((obj[i].c_time *
                                                    100
                                                ) /
                                                0.1
                                            )
                                            .toFixed(
                                                2
                                            )
                                        ],
                                        name: '学术水平',
                                        symbol: 'circle',

                                        symbolSize: 9,
                                        lineStyle: {
                                            color: 'rgba(170, 145, 200, 0.9)',
                                            type: 'dashed'
                                        },

                                        areaStyle: {
                                            color: new echarts
                                                .graphic
                                                .RadialGradient(
                                                    0.1,
                                                    0.6,
                                                    1,
                                                    [{
                                                            color: 'rgba(190, 145, 200, 0.1)',
                                                            offset: 0
                                                        },
                                                        {
                                                            color: 'rgba(190, 145, 200, 0.9)',
                                                            offset: 1
                                                        }
                                                    ]
                                                )
                                        },
                                        label: {
                                            show: true,
                                            fontSize: 15,
                                            color: '#6e42e6',
                                            formatter: function (
                                                params
                                            ) {
                                                return params
                                                    .value;
                                            }
                                        }
                                    }]
                                }]
                            };
                            option && myChart.setOption(option);
                        }


                    }
                })

            })


        })
    </script>
</body>

</html>